package com.springboot.springboot1.controller;

import com.springboot.springboot1.Bean.Car;
import com.springboot.springboot1.Bean.Person;
import com.springboot.springboot1.Bean.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName:
 * @author: CKC
 * @DateTime: 2021/1/10 17:25
 */
@Slf4j
@RestController
public class HelloController {
    
    @RequestMapping(value = "/hello",method = RequestMethod.GET)
    public String handle01() {
        log.info("============35werfdsfd------------");
        return "hello, Spring Boot2！";
    }
    
    @Resource
    Car car;
    
    @RequestMapping("/car")
    public Car car() {
        log.info("============35werfdsfd------------");
        return car;
    }
    
    
    @Autowired
    User user;
    
    @RequestMapping("/user")
    public User userTests(){
        return user;
    }
    
    
    @Autowired
    Person person;
    
    @RequestMapping(value = "/person")
    public Person person() {
        return person;
    }
}
